﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace RFC.PressureTest.EF
{
    class Program
    {
        static void Main(string[] args)
        {
            
            DbSet<object> set = new DbSet<object>();
            set.

            //Console.WriteLine($"开始Chloe测试");
            //using (MsSqlContext msSqlContext = new MsSqlContext("server=(local);user id=test;password=test;database=TestDb;"))
            //{
            //    IQuery<Order> query = msSqlContext.Query<Order>();
            //    //预热，因为我没去查阅你的源码，默认考虑预热
            //    query.FirstOrDefault();
            //    Stopwatch stopwatch = Stopwatch.StartNew();
            //    IList<long> tmsList = new List<long>();
            //    for (int i = 0; i < 10; i++)
            //    {
            //        stopwatch.Restart();
            //        var data = query.ToList();
            //        stopwatch.Stop();
            //        var tms = stopwatch.ElapsedMilliseconds;
            //        tmsList.Add(tms);
            //        Console.WriteLine($"耗时：{tms}");
            //    }
            //    Console.WriteLine($"平均：{tmsList.Average()}");
            //    Console.ReadKey();
            //}


            //Console.WriteLine($"开始Dapper测试");
            //using (IDbConnection connection = new SqlConnection("server=(local);user id=test;password=test;database=TestDb;"))
            //{
            //    //也进行预热
            //    connection.QueryFirst("SELECT TOP 1 OrderId,OrderNo FROM [Order]");
            //    Stopwatch stopwatch = Stopwatch.StartNew();
            //    IList<long> tmsList = new List<long>();
            //    for (int i = 0; i < 10; i++)
            //    {
            //        stopwatch.Restart();
            //        var data = connection.Query<Order>("SELECT OrderId,OrderNo FROM [Order]"); ;
            //        stopwatch.Stop();
            //        var tms = stopwatch.ElapsedMilliseconds;
            //        tmsList.Add(tms);
            //        Console.WriteLine($"耗时：{tms}");
            //    }
            //    Console.WriteLine($"平均：{tmsList.Average()}");
            //    Console.ReadKey();
            //}
        }
    }
}
